import request from '@/utils/request';
import type { DetailParams, UnitParams, UnitStatusOptions, StatusParams } from './data';

export async function getTable(params?: UnitParams) {
  // getUnitList: '/consult/api/sem/unit/list', // 获取单元表格数据
  return request('/api/sem/unit/list', {
    method: 'POST',
    data: params,
  });
}

// 获取第三方平台
export async function getPlatForms(params?: {}) {
  return request('/v1/sem/plan/getPlatforms', {
    method: 'POST',
    params
  })
}

// 获取第三方状态
export async function getPlatStatus(params?: UnitStatusOptions) {
  return request('/v1/sem/plan/getPlatformStatus', {
    method: 'POST',
    data: params
  })
}

// 单一启用停用
export async function changeStatus(params: StatusParams) {
  return request('/v1/sem/unit/status', {
    method: 'POST',
    data: params
  })
}

// 单一删除计划
export async function delPlan(params: number[]) {
  return request('/v1/sem/unit/delete', {
    method: 'POST',
    data: params
  })
}